<?php

namespace app\service;

use app\models\Card;
use app\models\Comments;
use yii\data\Pagination;

class DanmuService
{

    /**
     * 获取页面数据
     * @param $page
     * @param $pageSize
     * @return array
     */
    public function getPageParams($page, $pageSize)
    {
        list($rows, $total) = Comments::search($page, $pageSize);

        $pagination = new Pagination(['totalCount' => $total]);

        return array(
            'rows' => $rows,
            'pagination' => $pagination
        );
    }

}